/*
 * TCSS 422 Process Control Simulator
 * Group Money: Al McKenzie, Michael Pitts, Taylor Zielske
 */

/**
 * A scheduler that decides which Process should run next.
 * 
 * @author Michael Pitts
 * @version Dec 8, 2011
 */
public interface Scheduler {
	
	/**
	 * Gets the next Process that should run.
	 * @return the next Process that should run.
	 */
	public Process getNextProcess();
	
	/**
	 * Loads the given Processes into the scheduler.
	 * @param the_processes
	 */
	public void loadProcesses(final Process[] the_processes);
	
	/**
	 * Removes the given process from consideration.
	 * @param the_process is the process to no longer be scheduled.
	 */
	public void removeProcess(final Process the_process);
	
	/**
	 * Gets how many processes are left to run.
	 * @return the number of processes that could still be run.
	 */
	public int processesLeft();
	
	/**
	 * Sets a Process to be blocked.
	 * @param the_process is the process to block.
	 */
	public void blockProcess(final Process the_process);
	
	/**
	 * Sets a blocked Process as unblocked.
	 * @param the_process the process to unblock.
	 */
	public void unBlockProcess(final Process the_process);

	/**
	 * Adds the given process to the end of the scheduler.
	 * @param the_process a Process where its status is Waiting.
	 * @see Process#getStatus()
	 */
	public void pushProcess(final Process the_process);
	
	/**
	 * Gets the number of processes waiting to run.
	 * @return an integer representing how many processes are in the wait queue.
	 */
	public int getNumberWaiting();

}
